import { Tag } from '../../model/types/Tag'
import { TagElement } from '../TagElement/TagElement'

interface TagListProps {
  onAdd?: (tagId: string) => void
  onClick?: (tagId: string) => void
  tagList: Tag[] | undefined
}

export const TagList = ({ onAdd, onClick, tagList }: TagListProps) => {
  return (
    <>
      {tagList &&
        tagList?.map((tag) => (
          <TagElement key={tag.id} onAdd={onAdd} onClick={onClick} tag={tag} />
        ))}
    </>
  )
}
